﻿@model Finance.Web.Models.UserDeposit

<form class="form-horizontal" name="userDepositForm">

   <div class="form-group">
    <label for="deposit" class="col-sm-2 control-label">Депозит</label>
    <div class="col-sm-8" data-ng-switch="" data-on="!model.DepCode">
        <input data-ng-switch-when="true" id="deposit" type="text" data-ng-model="model.Deposit" placeholder="Выберите депозит" name="Deposit"  data-typeahead="state as state.Name for state in loadDeposites($viewValue)" class="form-control" required>
        <p data-ng-switch-default="" class="form-control">{{model.DepositName}}</p>
    </div>
  </div>

   <div class="form-group">
    <label for="amount" class="col-sm-2 control-label">Сумма</label>
    <div class="col-sm-8">
      <input type="number"  class="form-control" name="Amount" data-ng-model="model.Amount" id="amount" min="0" data-currency="">
    </div>
  </div>

  <div class="form-group">
    <label for="from" class="col-sm-2 control-label">Дата октрытия</label>
    <div class="col-sm-8" data-ng-show="true">
        <p class="input-group">
            <input type="text" class="form-control" id="from" data-datepicker-popup="" data-ng-model="model.OpeningDate" data-is-open="openedOpening" data-datepicker-options="" data-ng-required="true"/>
            <span class="input-group-btn">
                <button class="btn btn-default" data-ng-click="openedOpening=!openedOpening;"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
  </div>

  <div class="form-group">
    <label for="to" class="col-sm-2 control-label">Дата закрытия</label>
    <div class="col-sm-8" data-ng-show="true">
         <p class="input-group">
            <input type="text" class="form-control" id="to" data-datepicker-popup="" data-ng-disabled="true" data-ng-model="model.EndDate" data-is-open="openedEnd" data-datepicker-options=""/>
            <span class="input-group-btn">
                <button class="btn btn-default" data-ng-click="openedEnd=!openedEnd;"><i class="glyphicon glyphicon-calendar"></i></button>
            </span>
        </p>
    </div>
  </div>

  <div class="form-group">
    <div class="col-sm-offset-2 col-sm-2">
      <button type="submit" data-ng-click="createModel()" class="btn">Сохранить</button>
    </div>
    <div class="col-sm-2">
      <button data-ng-click="cancel()" class="btn">Отмена</button>
    </div>
  </div>  
</form>